<!-- inc:frame.top -->

<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=sysgroup&act=list">管理系统组</a> &raquo; <a href="{:$mainlink}?file=category&act=list&sysgroupid={:$sysgroupid}">分类管理</a> &raquo; <!-- if($act=="add") -->添加分类<!-- else -->编辑分类<!-- end --></p><!-- inc:position.fr --></div>

<div class="page_pad">
  <form method="post" action="{:$mainlink}?file=category&act=viewok&sysgroupid={:$sysgroupid}" onsubmit="return chkadd(this);">
  <div class="content_add"><button class="gbutton gbutton_dblue gbutton_add creat_button" type="submit"><!-- if($act=="add") -->添加<!-- else -->保存<!-- end --></button> &nbsp; <button type="button" class="gbutton gbutton_add" onclick="qgurl('{:$mainlink}?file=category&act=list&sysgroupid={:$sysgroupid}')">返回</button> &nbsp; <span class="show_step" style="color:red;"><img src="images/loading.gif" style="visibility:hidden;" /></span></div>
  
  <input type="hidden" value="{:$id}" name="id" id="id" />
  <div class="content_box">
    <div class="content_bor">
      <ul class="tabul">
        <li onclick="tabs(this,'tabbasic')" class="tabon"><a href="javascript:void(0)">基本信息</a></li>
        <!-- if($fieldlist) -->
        <li onclick="tabs(this,'tabfield')"><a href="javascript:void(0)">扩展信息</a></li>
        <!-- end -->
        <li onclick="tabs(this,'tabother')"><a href="javascript:void(0)">其他信息</a></li>
        <li onclick="tabs(this,'tabseo')"><a href="javascript:void(0)">SEO信息</a></li>
        <div class="clear"></div>
      </ul>
      
      <div id="tabbasic" class="tabdiv tabshow">
      <table class="ctable">
        <!-- if($system[jianti] == on) -->
        <tr>
          <td class="left">简体分类名称：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="catename" id="catename" value="{:$rs[catename]}" /></td>
        </tr>
        <!-- end -->
        <!-- if($system[fanti] == on) -->
        <tr>
          <td class="left">繁体分类名称：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="catename_ft" id="catename_ft" value="{:$rs[catename_ft]}" /></td>
        </tr>
        <!-- end -->
        <!-- if($system[english] == on) -->
        <tr>
          <td class="left">英文分类名称：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="catename_en" id="catename_en" value="{:$rs[catename_en]}" /></td>
        </tr>
        <!-- end -->
        <tr>
          <td class="left">上级分类：<span style="color:red;">*</span></td>
          <td class="right">
            <!-- if($cateid) -->
            <input class="ginput" type="text" name="tmp_catename" value="{:$catename}" disabled /><input type="hidden" value="{:$cateid}" name="cateid" />
            <!-- else -->
            <select name="cateid">
              <option value="0" style="color:red;">设为根分类</option>
              <!-- $catelist AS $key=>$value -->
              <option value="{:$value[id]}"{if($rs[parentid] == $value[id])} selected{end}>{:$value[space]}{:$value[catename]}&nbsp;|&nbsp;{:$value[catename_en]}&nbsp;|&nbsp;{:$value[catename_ft]}</option>
              <!-- end -->
            </select>
            &nbsp;
            <span>[请选择一个分类]</span>
            <!-- end -->
          </td>
        </tr>
        <!-- if($fieldgroup) -->
        <tr>
          <td class="left">分类字段方案：</td>
          <td class="right">
            <select name="fieldgroupid">
              <option value="0">无</option>
              <!-- $fieldgroup AS $key=>$value -->
              <option value="{:$value[id]}"{if($rs[fieldgroupid] == $value[id])} selected{end}>{:$value[groupname]}</option>
              <!-- end -->
            </select>
            &nbsp;
            <span><a href="{:$mainlink}?file=sysgroup&act=fieldgroup&sysgroupid={:$sysgroupid}"><span class="color_red">[编辑字段方案]</span></a></span>
          </td>
        </tr>
        <!-- end -->
        <tr>
          <td class="left">类别图：</td>
          <td class="right">
            <div id="rsdpic"><img id="rsdimg" src="{:$rsd[folder]}{:$rsd[thumbfile]}" style="{if($rsd[thumbfile])}height:100px;{else}height:0;{end} cursor:pointer" onclick="preview_thumb();" /></div>
            <span><button class="gbutton gbutton_min" type="button" onclick="qg_openthumb();">类别图</button></span>
            <span id="del_thumb" style="display:none;">
            <button class="gbutton gbutton_min" type="button" onclick="preview_thumb();">预览</button>
			<button class="gbutton gbutton_min" type="button" onclick="delete_thumb();">删除</button>
            </span>
            <input type="hidden" name="thumb" id="thumb" value="{:$rs[thumb]}" />
            &nbsp;
            <span>[仅支持一张产品图]</span>
          </td>
        </tr>
        <tr style="display:none;">
          <td class="left">类别图2：</td>
          <td class="right">
            <div id="rsdpic2"><img id="rsdimg2" src="{:$rsd2[folder]}{:$rsd2[thumbfile]}" style="{if($rsd2[thumbfile])}height:100px;{else}height:0;{end} cursor:pointer" onclick="preview_thumb(2);" /></div>
            <span><button class="gbutton gbutton_min" type="button" onclick="qg_openthumb(2);">类别图2</button></span>
            <span id="del_thumb2" style="display:none;">
            <button class="gbutton gbutton_min" type="button" onclick="preview_thumb(2);">预览</button>
            <button class="gbutton gbutton_min" type="button" onclick="delete_thumb(2);">删除</button>
            </span>
            <input type="hidden" name="thumb2" id="thumb2" value="{:$rs[thumb2]}" />
            &nbsp;
            <span>[仅支持一张产品图]</span>
          </td>
        </tr>
        <tr style="display:none;">
          <td class="left">类别图3：</td>
          <td class="right">
            <div id="rsdpic3"><img id="rsdimg3" src="{:$rsd3[folder]}{:$rsd3[thumbfile]}" style="{if($rsd3[thumbfile])}height:100px;{else}height:0;{end} cursor:pointer" onclick="preview_thumb(3);" /></div>
            <span><button class="gbutton gbutton_min" type="button" onclick="qg_openthumb(3);">类别图3</button></span>
            <span id="del_thumb3" style="display:none;">
            <button class="gbutton gbutton_min" type="button" onclick="preview_thumb(3);">预览</button>
            <button class="gbutton gbutton_min" type="button" onclick="delete_thumb(3);">删除</button>
            </span>
            <input type="hidden" name="thumb3" id="thumb3" value="{:$rs[thumb3]}" />
            &nbsp;
            <span>[仅支持一张产品图]</span>
          </td>
        </tr>
        <div id="preview_photo"></div>
        <!-- 加载内容编辑器信息 -->
        <input type="hidden" id="sysid" value="{:$sysgroupid}" />
		<script>
		var sysid = document.getElementById("sysid").value;
		</script>
        <tr>
          <td class="left">内容：</td>
          <td class="right">
            <!-- if($_SESSION[admin][editorid]==0) -->
            <!-- inc:xheditor.qg -->
            <!-- elseif($_SESSION[admin][editorid]==1) -->
            <!-- inc:editorue.qg -->
            <!-- end -->
          </td>
        </tr>
      </table>
      </div><!--basic-->
      
      <!-- if($fieldlist) -->
      <input type="hidden" name="isfield" value="1" />
      <div id="tabfield" class="tabdiv">
      </div><!--tabfield-->
      <!-- end -->
      
      <div id="tabother" class="tabdiv">
      <table class="ctable">
        <tr>
          <td class="left">显示：</td>
          <td class="right">
            <input type="radio" name="status" value="1"{if($rs[status] == 1)} checked{end}>显示
            &nbsp;
            <input type="radio" name="status" value="0"{if($rs[status] == 0 || !$rs[status])} checked{end}>隐藏
            &nbsp;
            <span>[暂时不使用的分类可以点隐藏，前台将不会显示]</span>
          </td>
        </tr>
        <tr>
          <td class="left">排序：</td>
          <td class="right">
            <input class="ginput" type="text" name="taxis" id="taxis" value="{if($id)}{:$rs[taxis]}{else}1{end}" />
            &nbsp;
            <span>[数值越小越往前靠，最大不能超过255]</span>
          </td>
        </tr>
        <tr>
          <td class="left">每页显示数：</td>
          <td class="right">
            <input class="ginput" type="text" name="psize" value="{:$rs[psize]}" />
            &nbsp;
            <span>[列表每页显示数目，建议不要超过50]</span>
          </td>
        </tr>
        <tr style="display:none;">
          <td class="left">主题排序：</td>
          <td class="right">
            <select name="showtype">
              <option value="0">默认排序</option>
              <option value="1"{if($rs[showtype] == 1)} selected{end}>最新发布排序</option>
              <option value="2"{if($rs[showtype] == 2)} selected{end}>点击率高的排前面</option>
              <option value="3"{if($rs[showtype] == 3)} selected{end}>点击率低的排前面</option>
            </select>
            &nbsp;
            <span>[后台设置的置顶将不受此影响]</span>
          </td>
        </tr>
        <tr>
          <td class="left">分类封面模板：</td>
          <td class="right">
            <input class="ginput" type="text" name="tpl_index" id="tpl_index" value="{:$rs[tpl_index]}" />
            &nbsp;
            <span>[分类封面自定义模板，不包含后缀]</span>
          </td>
        </tr>
        <tr>
          <td class="left">分类列表模板：</td>
          <td class="right">
            <input class="ginput" type="text" name="tpl_list" id="tpl_list" value="{:$rs[tpl_list]}" />
            &nbsp;
            <span>[分类列表自定义模板，不包含后缀]</span>
          </td>
        </tr>
        <tr>
          <td class="left">分类主题模板：</td>
          <td class="right">
            <input class="ginput" type="text" name="tpl_msg" id="tpl_msg" value="{:$rs[tpl_msg]}" />
            &nbsp;
            <span>[分类主题自定义模板，不包含后缀]</span>
          </td>
        </tr>
      </table>
      </div><!--tabother-->
      
      <div id="tabseo" class="tabdiv">
        <table class="ctable">
          <!-- if($system[jianti]==on) -->
          <tr>
            <td class="left">中文网站标题：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_title" id="meta_title" value="{:$rs[meta_title]}" /></td>
          </tr>
          <tr>
            <td class="left">中文网站关键字：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_keywords" id="meta_keywords"  value="{:$rs[meta_keywords]}" /></td>
            </tr>
          <tr>
            <td class="left">中文网站描述：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_description" id="meta_description"  value="{:$rs[meta_description]}" /></td>
          </tr>
          <!-- end -->
          <!-- if($system[english]==on) -->
          <tr>
            <td class="left">英文网站标题：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_title_en" id="meta_title_en" value="{:$rs[meta_title_en]}" /></td>
          </tr>
          <tr>
            <td class="left">英文网站关键字：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_keywords_en" id="meta_keywords_en"  value="{:$rs[meta_keywords_en]}" /></td>
          </tr>
          <tr>
            <td class="left">英文网站描述：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_description_en" id="meta_description_en"  value="{:$rs[meta_description_en]}" /></td>
          </tr>
          <!-- end -->
          <!-- if($system[fanti]==on) -->
          <tr>
            <td class="left">繁体网站标题：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_title_ft" id="meta_title_ft" value="{:$rs[meta_title_ft]}" /></td>
          </tr>
          <tr>
            <td class="left">繁体网站关键字：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_keywords_ft" id="meta_keywords_ft"  value="{:$rs[meta_keywords_ft]}" /></td>
          </tr>
          <tr>
            <td class="left">繁体网站描述：</td>
            <td class="right"><input class="ginput ginput_ful" type="text" name="meta_description_ft" id="meta_description_ft"  value="{:$rs[meta_description_ft]}" /></td>
          </tr>
          <!-- end -->
        </table>
      </div><!--tabseo-->
    </div>
  </div><!--content_box-->
  
  <div class="gbutton_div"><button type="submit" class="gbutton gbutton_dblue gbutton_add creat_button">保存</button> &nbsp; <button type="button" class="gbutton gbutton_add" onclick="qgurl('{:$mainlink}?file=category&act=list&sysgroupid={:$sysgroupid}')">返回</button> &nbsp; <span class="show_step" style="color:red;"><img src="images/loading.gif" style="visibility:hidden;" /></span></div>
  </form>
</div><!--page_pad-->

<script type="text/javascript">
function qg_openthumb(id)
{
	if(!id){id="";}
	var values = document.getElementById("thumb"+id).value;
	var url;
	url = "{:$mainlink}?file=open.addthumb"+id+"&act=add&values=" + values + "&sysgroupid={:$sysgroupid}";
	qg_open(url,"540");
}
function preview_thumb(id)
{
	if(!id){id="";}
	var values = document.getElementById("thumb"+id).value;
	var url;
	url = "{:$mainlink}?file=open.viewpic&id=" + values + "&type=thumb";
	qg_open(url,"540");
}
function delete_thumb(id)
{
	if(!id){id="";}
	document.getElementById("thumb"+id).value = "";
	document.getElementById("del_thumb"+id).style.display = "none";
	document.getElementById("rsdimg"+id).src = "";
	document.getElementById("rsdimg"+id).style.height = "0";
}
function chk_thumb()
{
	var values = document.getElementById("thumb").value;
	if(values && values != "0")
	{
		document.getElementById("del_thumb").style.display = "";
	}
	
	var values2 = document.getElementById("thumb2").value;
	if(values2 && values2 != "0")
	{
		document.getElementById("del_thumb2").style.display = "";
	}
	
	var values3 = document.getElementById("thumb3").value;
	if(values3 && values3 != "0")
	{
		document.getElementById("del_thumb3").style.display = "";
	}
}
chk_thumb();
</script>

<script type="text/javascript">
function chkadd(o)
{
	<!-- if($_SESSION[admin][editorid]==1) -->
	<!-- if($system[jianti] == on) -->
	document.getElementById("content").value=UE.getEditor('myEditor').getContent();
	<!-- end -->
	<!-- if($system[english] == on) -->
	document.getElementById("content_en").value=UE.getEditor('myEditor_en').getContent();
	<!-- end -->
	<!-- if($system[fanti] == on) -->
	document.getElementById("content_ft").value=UE.getEditor('myEditor_ft').getContent();
	<!-- end -->
	<!-- end -->
	
	if(!o.sysgroupid.value)
	{
		tip_msg("分类信息有误");
		qgurl("{:$mainlink}?file=sysgroup&act=list");
		return false;
	}
	<!-- if($system[jianti] == on) -->
	if(!o.catename.value)
	{
		tip_msg("分类名称不允许为空");
		return false;
	}
	<!-- end -->
	$(".show_step").html("<img src='images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...");
	$(".creat_button").attr("disabled","disabled");
}
</script>

<!-- inc:frame.bottom -->